<div class="ibox">
	<div class="ibox-content">
		<form method="post" class="form-horizontal" action="${cxt!}/upcoming/events/add" id="articleForm" >
			<div class="form-group">
				<div class="col-md-2"></div>
				<div class="col-md-1">
					<label>${_res["upcoming.events.url"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-3">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadproimgfiles">
							<!-- //ajax片段开始 -->
							<%  #ajax uploadproimgfiles: {%> 
								<% if(uploadFile! !=null) {%> 
									<input type="hidden" name="upcoming.url" value="${uploadFile.path!}" /> 
									<img src="${imgCxt!}/${uploadFile.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
								<% } %> 
							<% } %>
							<!-- //ajax片段结尾 -->
						</a> 
						<input type="file" style="opacity: 0" id="fileuploadproimgfiles" name="url" />
					</div>
				</div>

				<div class="col-md-1">
					<label>${_res["upcoming.events.urlen"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<!-- 上传英文封面 -->
				<div class="col-md-3">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadDatumFile">
							<!-- //ajax片段开始  -->
							<% #ajax uploadDatumFile: {%> 
								<% if (uploadFiles! != null) { %>
									<input type="hidden" name="upcoming.urlen" value="${uploadFiles.path!}" />
									<img src="${imgCxt!}/${uploadFiles.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
								<% } %>
							<% } %>
							<!-- //ajax片段结尾 -->
						</a> 
						<input type="file" style="opacity: 0" id="fileuploadDatumFile" name="urlen" />
					</div>
				</div>
			</div>
			<div class="hr-line-dashed"></div>

			<div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.title"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.title" required aria-required="true">
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["upcoming.events.titleen"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="upcoming.titleen" required aria-required="true">
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.contacter"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.contacter" required aria-required="true">
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["upcoming.events.emailcontact"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div id="divId" class="col-md-3">
	              	<input type="text" class="form-control" name="upcoming.emailcontact" required aria-required="true">
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.mobilecontact"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="upcoming.mobilecontact" required aria-required="true">
                </div>	   
                
                <label class="col-sm-2 control-label">${_res["upcoming.events.status"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict type="select"  name="upcoming.status" id="status" dictCode="COMMON_STATUS" />
                </div>
           </div>
           <div class="hr-line-dashed"></div>
          
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["upcoming.events.fromTime"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <input id="fromTimeDivId" class="form-control layer-date laydate-icon" name="upcoming.fromTime" placeholder="${_res['upcoming.events.fromTime']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required aria-required="true" />
                </div>
                                
	            <label class="col-md-2 control-label">${_res["upcoming.events.toTime"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
	              <input class="form-control layer-date laydate-icon" name="upcoming.toTime" placeholder="${_res['upcoming.events.toTime']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" data-rule-comparedate="#fromTimeDivId" required aria-required="true" />
	            </div>
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-md-2 control-label">${_res["upcoming.events.eventdate"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
                   <input class="form-control layer-date laydate-icon" name="upcoming.eventdate" placeholder="${_res['upcoming.events.eventdate']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required aria-required="true" />
	            </div>	   

                <label class="col-md-2 control-label">${_res["upcoming.events.address"]}:<span class="fontColorRed">&nbsp;*</span></label>
	            <div class="col-md-3">
                   <input type="text" class="form-control" name="upcoming.address" placeholder="${_res['upcoming.events.address']}" required aria-required="true" />
	            </div>	   
           </div>
           <div class="hr-line-dashed"></div>

			<div class="form-group">
				<label class="col-md-2 control-label">${_res["upcoming.events.content"]}:<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-8">
					<script id="container" name="upcoming.content" type="text/plain" style="width:100%; min-height:450px !important"></script>
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			
			<div class="form-group">
				<label class="col-md-2 control-label">${_res["upcoming.events.contenten"]}:<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-8">
					<script id="container_english" name="upcoming.contenten" type="text/plain" style="width:100%; min-height:450px !important"></script>
				</div>
			</div>
			
			<div class="form-group" style="margin-bottom:55px;">
				<div class="row">
					<div class="col-md-6">
						<label class="col-md-12 control-label"> 
							<% if(hasPrivilegeUrl("upcomingList")){ %>
								<button type="button" class="btn btn-warning" onClick="ajaxContent('/upcoming/events/list');">${_res["system.return"]}</button>
							<% } %> 
							<% if(hasPrivilegeUrl("upcomingAdd")){ %>
								<button type="submit" class="btn btn-primary"> ${_res["system.submit"]} </button> 
							<% } %> 
						</label>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<#submit formId="articleForm" divId="content" />

<script>
	$(document).ready(function() {
		//获取当前系统的语言
		var editor = new UE.ui.Editor();  
	    editor.render("container");
		
	    //获取当前系统的语言
	    var editor_english = new UE.ui.Editor();  
	    editor_english.render("container_english");
		
		$("a[id^='upload']").on('click', function() {
			var id = $(this).attr("id");
			$("#file" + id).click();
		});
		
		// 选择文件之后执行上传ajaxFileUpload2(divId,fileElementId,toUrl,uploadType,uploadFiles,callback)
		$("input[id^='fileuploadproimgfiles']").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadproimgfiles" , fileElementId , "/realty/academyarticle/upcomingEvents/add.html#uploadproimgfiles" , "upcomingEvents","uploadFile");
		});
		
		//上传英文封面  选择文件之后执行上传
		$("input[id^='fileuploadDatumFile'").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadDatumFile",fileElementId,"/realty/academyarticle/upcomingEvents/add.html#uploadDatumFile","upcomingEvents","uploadFiles");
		});
	});
</script>